class UsersController < ApplicationController
  before_filter [:init_custom_includes, :init_trace_nav]
  before_filter :get_current_user,
    :only => [:edit, :update]
    
  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    if @user.save
			@user.setup_user_dir
      flash[:notice] = "Registration successful."
      redirect_to root_url
    else
      render :action => 'new'
    end
  end

  def edit
  end

  def update
    if @user.update_attributes(params[:user])
      flash[:notice] = "Successfully updated profile."
      redirect_to root_url
    else
      render :action => 'edit'
    end
  end

  private
    def get_current_user
      @user = current_user
    end
end

